/*
 * Created on 03.12.2005
 * 
 * ChangePlayerTypeInfo bekommt vom OtherParser Playernummer und Playertype
 * 
 */

package robocup.component.infotypes;

import robocup.parser9.Token;

/**
 * This Information is received, if the own coach assigns a heterogeneous
 * player-type to an agent.
 */
public class ChangePlayerTypeInfo
    extends Info {

  /**
   * The number of the player, which has a new player-type.
   */
  protected int playerNumber;

  /**
   * The id of the new player-type [0,6]
   */
  protected int playerType;

  /**
   * @return Returns the number of the player, who has a new player-type.
   */
  public int getPlayerNumber() {

    return this.playerNumber;
  }

  /**
   * @return Returns the id of the player-type, which was assigned to the
   *         player.
   */
  public int getPlayerType() {

    return this.playerType;
  }

  /**
   * Constructs an info-object holding the new playertype of a given player
   * 
   * @param playerNumber -
   *          the agents unum
   * @param playerType -
   *          the agents new playerType
   */
  public ChangePlayerTypeInfo(
      final Token playerNumber,
      final Token playerType) {

    super(-1);
    this.playerNumber = Integer.parseInt(playerNumber.toString());
    this.playerType = Integer.parseInt(playerType.toString());
    this.infoType = Info.TYPE_PLAYERTYPE;
  }
}
